﻿
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>评教详情</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link rel="stylesheet" type="text/css" href="/MobWeb/css/bootstrap3.3.5/css/bootstrap.css">
    <link href="/MobWeb/CSS/people/style.css?v=2" rel="stylesheet" />
    <link rel="stylesheet" href="/MobWeb/CSS/elem/index.css">
    <style>

        .el-select-dropdown__item {
            height: auto !important;
            /*border-bottom: 1px solid #eef1f7;*/
        }

        .el-message-box {
            width: auto;
        }

        .btn-primary {
            background-color: #409EFF !important;
            /*background-color: #F5F7FA !important;*/
            border: 0px;
        }

        .el-dropdown-link {
            cursor: pointer;
            color: #409EFF;
        }

        .el-tabs--border-card {
            border: 0px !important;
            box-shadow: 0 0 black !important;
        }

        .el-icon-arrow-down {
            font-size: 12px;
        }

        .right-panel {
            position: fixed;
            bottom: 3rem;
            right: 1rem;
        }

            .right-panel img {
                width: 100%;
                height: 100%;
            }

            .right-panel ul {
                margin: 0;
                padding: 0
            }

            .right-panel li {
                width: 46px;
                height: 46px;
                list-style: none;
                margin-top: .3rem;
                opacity: .9
            }

        .mark {
            background-color: transparent !important;
        }
    </style>
</head>
<body style="background-color:transparent">
    <section class="aui-flexView" id="app" style="display:none">
        <header class="aui-navBar aui-navBar-fixed" style="display:none">
            <a href="javascript:;" class="aui-navBar-item">
                <i class="icon icon-return"></i>
            </a>
            <div class="aui-center">
                <span class="aui-center-title"></span>
            </div>
            <a href="javascript:;" class="aui-navBar-item">
                <!--<i class="icon icon-news"></i>-->
            </a>
        </header>
        <section class="aui-scrollView" >
            <div class="aui-health-head" style="height: 90px;display:none">
                <div class="aui-flex" style="padding-top: 20PX;">
                    <div class="aui-health-user">
                        <img src="/MobWeb/Images/icon/Info.jpg" alt="">
                    </div>
                    <div class="aui-flex-box">
                        <h1 style="font-size:16px">学生评教</h1>
                    </div>
                </div>

            </div>


            <el-card shadow="always" style=" position: fixed; width: 92%; bottom: 10px; z-index: 1000; margin: 15px;">
                <el-row :gutter="10">
                    <el-col :span="10">
                        <span style=" line-height: 28px; font-size: 14px;">得分<span style="color:red" v-text="zf"></span>分</span>
                    </el-col>
                    <el-col :span="14" style="text-align:right">
                        <el-button type="success" @click="savepj()" style="width:90%" size="mini" round>提交数据</el-button>

                    </el-col>
                </el-row>
            </el-card>
            <el-tabs type="border-card">
                <el-tab-pane style="min-height:300px">
                    <span slot="label"><i class="el-icon-date"></i>评教信息</span>

                    <el-row>

                        <el-col :span="24">
                            <el-alert title="评教说明"
                                      type="warning"
                                      description="1．参加教学评价是学生的责任与义务，是同学们参与学校管理的体现，有益于教师教学水平的提高，也是对同学们判断是非能力的一次训练，请认真评价，无需署名，且不允许代他人评价；2．评价结果满分，评价无效；"
                                      show-icon>
                            </el-alert>
                            <el-card shadow="always" v-for="item in dataset" style="margin-top:10px;font-size:13px">
                                <div>
                                    <el-row :gutter="20">
                                        <el-col :span="12">
                                            <span>
                                                <img src="/MobWeb/Images/icon/Info.jpg" style="height:30px;width:30px;border-radius:25%" />
                                                <span style="margin-left:5px;font-weight:bolder;position:absolute;top:10px">
                                                    {{item.yjzbmc}}【{{item.qz*100}}分】
                                                </span>
                                            </span>
                                        </el-col>
                                        <el-col :span="12">
                                            <span style="float:right;color:cornflowerblue;display:none">
                                                <el-tag type="success">
                                                    分值: {{item.qz*100}}
                                                </el-tag>
                                            </span>
                                        </el-col>
                                    </el-row>
                                </div>
                                <div style="margin-top:5px">
                                    <span>{{item.pjnr}}</span>
                                </div>
                                <div style="margin-top:15px">

                                    <el-radio-group v-model="item.zbdf">
                                        <el-radio v-for="zbitem in zbdata" :label="zbitem.TypeNO+','+zbitem.TypeName">{{item.qz|covdf(zbitem)}}</el-radio>
                                    </el-radio-group>
                                </div>
                            </el-card>

                            <el-input type="textarea"
                                      :autosize="{ minRows: 4, maxRows: 6}"
                                      placeholder="留言板"
                                      v-model="pjsm" style="margin-top:10px">
                            </el-input>

                            <el-button type="success" style="width: 100%; margin-top: 10px; visibility:collapse">提交评教数据</el-button>


                        </el-col>
                    </el-row>
                </el-tab-pane>



            </el-tabs>


            <div style="height:55px;"></div>
        </section>

    </section>
    <script src="/MobWeb/js/jquery-1.11.2.min.js"></script>
    <script src="/MobWeb/js/vue.js"></script>
    <script src="/MobWeb/js/lodash.min.js"></script>
    <script src="/MobWeb/css/elem/index.js"></script>
    <script src="/ViewV5/JS/SZHLCommon.js?V=2021" type="text/javascript"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                dialogVisible: false,
                activeName: 'first',
                dataset: [],
                dataid: ComFunJS.getQueryString("dataid", "0"),
                rwid: ComFunJS.getQueryString("rwid", "0"),
                xq: ComFunJS.getQueryString("xq", ""),
                xh: ComFunJS.getQueryString("xh", ""),
                zbdata: [],
                zf: 0,//得分
                pjsm:"",
                radio: null,
                iconClasses: ['icon-rate-face-1', 'icon-rate-face-2', 'icon-rate-face-3'] // 等同于 { 2: 'icon-rate-face-1', 4: { value: 'icon-rate-face-2', excluded: true }, 5: 'icon-rate-face-3' }
            },
            filters: {
                covdf: function (value, args) {
                    var s = args.TypeName * 1;
                    var s1 = value * 100;
                    //return s1 * s args.TypeNO + ;
                    return  (s * s1) + '分';
                }
            },
            methods: {
                golist: function () {
                    window.location.href = "javascript:history.go(-1)";
                },
                savepj: function () {
                    var pro = this;
                    var len = _.findIndex(pro.dataset, function (obj) {
                        return !obj.zbdf;
                    })
                    if (len * 1 > -1) {
                        pro.walert("有未评价的指标哦！");
                        return;
                    }
                    if (pro.zf=="100") {
                        pro.walert("不能打满分哦！");
                        return;
                    }
                    $.getJSON('/API/VIEWAPI.ashx?Action=JWUSER_SAVEPJDATA', { P1: pro.xh, pjdata: JSON.stringify(pro.dataset), P2: pro.rwid, dataid: pro.dataid, zf: pro.zf, pjsm: pro.pjsm}, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            pro.walert("操作成功!");
                            setTimeout("app.golist()", 1000);
                        }
                    })
                },
                walert: function (con) {
                    this.$alert('<span style="min-width:120px;display: block;">' + con + '</span>', '警告', {
                        confirmButtonText: '确定',
                        dangerouslyUseHTMLString: true,
                        callback: action => {
                        }
                    });
                },
                query: function () {
                    var pro = this;
                    const loading = pro.$loading({
                        lock: true,
                    });
                    $.getJSON('/API/VIEWAPI.ashx?Action=JWUSER_INITPJZB', { P1: pro.xh, dataid: pro.dataid, P2: pro.xq }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            if (pro.dataid == "0") {
                                _.forEach(resultData.Result, function (obj) {
                                    obj.zbdf = "";
                                })
                                pro.dataset = resultData.Result;
                            } else {
                                pro.dataset = JSON.parse(resultData.Result2[0].pjmx);
                                pro.pjsm = resultData.Result2[0].pjsm;

                                
                            }
                            pro.zbdata = resultData.Result1;
                            loading.close();
                            $("#app").show();

                        }
                    })
                }
            },
            mounted: function () {
                var pro = this;
                pro.$nextTick(function () {
                    pro.query();
                })
            },
            watch: {
                'dataset': { //深度监听，可监听到对象、数组的变化
                    handler(newV, oldV) {
                        var pro = this;
                        if (newV) {
                            pro.zf = 0;
                            _.forEach(pro.dataset, function (obj) {
                                if (obj.zbdf) {
                                    pro.zf = pro.zf * 1 + (obj.qz * 100) * (obj.zbdf.split(',')[1] * 1);
                                }
                            })
                        }
                    },
                    deep: true
                },
            }

        })


    </script>
</body>
</html>
